package com.cdte.gateway.bridge;

import com.cdte.entry.TableIndexDO;
import com.cdte.entry.TableInfoDO;
import com.cdte.gateway.CommonGateway;
import com.tool.common.config.DaoMapperProxy;

import java.util.List;

/**
 * @author zhoubin
 * @date 2022/10/31 19:49
 */
public class CommGatewayBridge {

    private static CommonGateway commonGateway;

    static {
        commonGateway = DaoMapperProxy.getProxyInstance(CommonGateway.class);
    }

    public static List<String> selectAllTables() {
        return commonGateway.selectAllTables();
    }

    /**
     * 查询数据库表信息
     * @param datebaseName
     * @param tableName
     * @return
     */
    public static List<TableInfoDO> selectTableInfo(String datebaseName, String tableName) {
        return commonGateway.selectTableInfo(datebaseName, tableName);
    }

    /**
     * 查询数据库索引信息
     * @param datebaseName
     * @param tableName
     * @return
     */
    public static List<TableIndexDO> selectTableIndexInfo(String datebaseName, String tableName) {
        return commonGateway.selectTableIndexInfo(datebaseName, tableName);
    }
}
